from fastapi import APIRouter, Depends

from app.core.responses import Response
from app.schemas.friends import FriendsSM, FriendsStatusSM
from app.services.auth import get_current_user
from app.services.friends import FriendsServices

router = APIRouter()


@router.post('/friends')
def store(form: FriendsSM, user:str= Depends(get_current_user)):
    if FriendsServices.store(user.id, form):
        return Response.message('操作成功！')
    return Response.message('操作失败！')



@router.post('/friends_status/{id}')
def store(id: int, form: FriendsStatusSM, user:str= Depends(get_current_user)):
    if FriendsServices.status(id, form):
        return Response.message('操作成功！')
    return Response.message('操作失败！')
